/**
 * @file ebex_crc.c
 *
 * @date Sep 9, 2010
 * @author seth
 * 
 * @brief This file is part of EBEX State Estimator, created for the EBEX project
 *
 * This software is copyright (C) 2010 Columbia University
 *
 * EBEX State Estimator is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * EBEX State Estimator is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with EBEX State Estimator; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
#include <stdint.h>
#include <stddef.h>

#define SHIFT_DOWN_8(x) ((x) >> 8)
#define LOW_BYTE(x) ((x) & 0xFF)
#define HIGH_BYTE(x) (((x) >> 16) & 0xFF)
#define HIGH_NYBLE(x) ((x) >> 24)

static const uint16_t ebex_crc16_table[256] = {
    0x0000U,0x8BB7U,0x9CD9U,0x176EU,0xB205U,0x39B2U,0x2EDCU,0xA56BU,
    0xEFBDU,0x640AU,0x7364U,0xF8D3U,0x5DB8U,0xD60FU,0xC161U,0x4AD6U,
    0x54CDU,0xDF7AU,0xC814U,0x43A3U,0xE6C8U,0x6D7FU,0x7A11U,0xF1A6U,
    0xBB70U,0x30C7U,0x27A9U,0xAC1EU,0x0975U,0x82C2U,0x95ACU,0x1E1BU,
    0xA99AU,0x222DU,0x3543U,0xBEF4U,0x1B9FU,0x9028U,0x8746U,0x0CF1U,
    0x4627U,0xCD90U,0xDAFEU,0x5149U,0xF422U,0x7F95U,0x68FBU,0xE34CU,
    0xFD57U,0x76E0U,0x618EU,0xEA39U,0x4F52U,0xC4E5U,0xD38BU,0x583CU,
    0x12EAU,0x995DU,0x8E33U,0x0584U,0xA0EFU,0x2B58U,0x3C36U,0xB781U,
    0xD883U,0x5334U,0x445AU,0xCFEDU,0x6A86U,0xE131U,0xF65FU,0x7DE8U,
    0x373EU,0xBC89U,0xABE7U,0x2050U,0x853BU,0x0E8CU,0x19E2U,0x9255U,
    0x8C4EU,0x07F9U,0x1097U,0x9B20U,0x3E4BU,0xB5FCU,0xA292U,0x2925U,
    0x63F3U,0xE844U,0xFF2AU,0x749DU,0xD1F6U,0x5A41U,0x4D2FU,0xC698U,
    0x7119U,0xFAAEU,0xEDC0U,0x6677U,0xC31CU,0x48ABU,0x5FC5U,0xD472U,
    0x9EA4U,0x1513U,0x027DU,0x89CAU,0x2CA1U,0xA716U,0xB078U,0x3BCFU,
    0x25D4U,0xAE63U,0xB90DU,0x32BAU,0x97D1U,0x1C66U,0x0B08U,0x80BFU,
    0xCA69U,0x41DEU,0x56B0U,0xDD07U,0x786CU,0xF3DBU,0xE4B5U,0x6F02U,
    0x3AB1U,0xB106U,0xA668U,0x2DDFU,0x88B4U,0x0303U,0x146DU,0x9FDAU,
    0xD50CU,0x5EBBU,0x49D5U,0xC262U,0x6709U,0xECBEU,0xFBD0U,0x7067U,
    0x6E7CU,0xE5CBU,0xF2A5U,0x7912U,0xDC79U,0x57CEU,0x40A0U,0xCB17U,
    0x81C1U,0x0A76U,0x1D18U,0x96AFU,0x33C4U,0xB873U,0xAF1DU,0x24AAU,
    0x932BU,0x189CU,0x0FF2U,0x8445U,0x212EU,0xAA99U,0xBDF7U,0x3640U,
    0x7C96U,0xF721U,0xE04FU,0x6BF8U,0xCE93U,0x4524U,0x524AU,0xD9FDU,
    0xC7E6U,0x4C51U,0x5B3FU,0xD088U,0x75E3U,0xFE54U,0xE93AU,0x628DU,
    0x285BU,0xA3ECU,0xB482U,0x3F35U,0x9A5EU,0x11E9U,0x0687U,0x8D30U,
    0xE232U,0x6985U,0x7EEBU,0xF55CU,0x5037U,0xDB80U,0xCCEEU,0x4759U,
    0x0D8FU,0x8638U,0x9156U,0x1AE1U,0xBF8AU,0x343DU,0x2353U,0xA8E4U,
    0xB6FFU,0x3D48U,0x2A26U,0xA191U,0x04FAU,0x8F4DU,0x9823U,0x1394U,
    0x5942U,0xD2F5U,0xC59BU,0x4E2CU,0xEB47U,0x60F0U,0x779EU,0xFC29U,
    0x4BA8U,0xC01FU,0xD771U,0x5CC6U,0xF9ADU,0x721AU,0x6574U,0xEEC3U,
    0xA415U,0x2FA2U,0x38CCU,0xB37BU,0x1610U,0x9DA7U,0x8AC9U,0x017EU,
    0x1F65U,0x94D2U,0x83BCU,0x080BU,0xAD60U,0x26D7U,0x31B9U,0xBA0EU,
    0xF0D8U,0x7B6FU,0x6C01U,0xE7B6U,0x42DDU,0xC96AU,0xDE04U,0x55B3U,
    };

static const uint32_t ebex_crc32_table[8][256] = { {
	0x00000000, 0x3B332844, 0x76665088, 0x4D5578CC, 0xECCCA110, 0xD7FF8954, 0x9AAAF198, 0xA199D9DC, 0x0EB90201,
	0x358A2A45, 0x78DF5289, 0x43EC7ACD, 0xE275A311, 0xD9468B55, 0x9413F399, 0xAF20DBDD, 0x1D720402, 0x26412C46,
	0x6B14548A, 0x50277CCE, 0xF1BEA512, 0xCA8D8D56, 0x87D8F59A, 0xBCEBDDDE, 0x13CB0603, 0x28F82E47, 0x65AD568B,
	0x5E9E7ECF, 0xFF07A713, 0xC4348F57, 0x8961F79B, 0xB252DFDF, 0x3AE40804, 0x01D72040, 0x4C82588C, 0x77B170C8,
	0xD628A914, 0xED1B8150, 0xA04EF99C, 0x9B7DD1D8, 0x345D0A05, 0x0F6E2241, 0x423B5A8D, 0x790872C9, 0xD891AB15,
	0xE3A28351, 0xAEF7FB9D, 0x95C4D3D9, 0x27960C06, 0x1CA52442, 0x51F05C8E, 0x6AC374CA, 0xCB5AAD16, 0xF0698552,
	0xBD3CFD9E, 0x860FD5DA, 0x292F0E07, 0x121C2643, 0x5F495E8F, 0x647A76CB, 0xC5E3AF17, 0xFED08753, 0xB385FF9F,
	0x88B6D7DB, 0x75C81008, 0x4EFB384C, 0x03AE4080, 0x389D68C4, 0x9904B118, 0xA237995C, 0xEF62E190, 0xD451C9D4,
	0x7B711209, 0x40423A4D, 0x0D174281, 0x36246AC5, 0x97BDB319, 0xAC8E9B5D, 0xE1DBE391, 0xDAE8CBD5, 0x68BA140A,
	0x53893C4E, 0x1EDC4482, 0x25EF6CC6, 0x8476B51A, 0xBF459D5E, 0xF210E592, 0xC923CDD6, 0x6603160B, 0x5D303E4F,
	0x10654683, 0x2B566EC7, 0x8ACFB71B, 0xB1FC9F5F, 0xFCA9E793, 0xC79ACFD7, 0x4F2C180C, 0x741F3048, 0x394A4884,
	0x027960C0, 0xA3E0B91C, 0x98D39158, 0xD586E994, 0xEEB5C1D0, 0x41951A0D, 0x7AA63249, 0x37F34A85, 0x0CC062C1,
	0xAD59BB1D, 0x966A9359, 0xDB3FEB95, 0xE00CC3D1, 0x525E1C0E, 0x696D344A, 0x24384C86, 0x1F0B64C2, 0xBE92BD1E,
	0x85A1955A, 0xC8F4ED96, 0xF3C7C5D2, 0x5CE71E0F, 0x67D4364B, 0x2A814E87, 0x11B266C3, 0xB02BBF1F, 0x8B18975B,
	0xC64DEF97, 0xFD7EC7D3, 0xEB902010, 0xD0A30854, 0x9DF67098, 0xA6C558DC, 0x075C8100, 0x3C6FA944, 0x713AD188,
	0x4A09F9CC, 0xE5292211, 0xDE1A0A55, 0x934F7299, 0xA87C5ADD, 0x09E58301, 0x32D6AB45, 0x7F83D389, 0x44B0FBCD,
	0xF6E22412, 0xCDD10C56, 0x8084749A, 0xBBB75CDE, 0x1A2E8502, 0x211DAD46, 0x6C48D58A, 0x577BFDCE, 0xF85B2613,
	0xC3680E57, 0x8E3D769B, 0xB50E5EDF, 0x14978703, 0x2FA4AF47, 0x62F1D78B, 0x59C2FFCF, 0xD1742814, 0xEA470050,
	0xA712789C, 0x9C2150D8, 0x3DB88904, 0x068BA140, 0x4BDED98C, 0x70EDF1C8, 0xDFCD2A15, 0xE4FE0251, 0xA9AB7A9D,
	0x929852D9, 0x33018B05, 0x0832A341, 0x4567DB8D, 0x7E54F3C9, 0xCC062C16, 0xF7350452, 0xBA607C9E, 0x815354DA,
	0x20CA8D06, 0x1BF9A542, 0x56ACDD8E, 0x6D9FF5CA, 0xC2BF2E17, 0xF98C0653, 0xB4D97E9F, 0x8FEA56DB, 0x2E738F07,
	0x1540A743, 0x5815DF8F, 0x6326F7CB, 0x9E583018, 0xA56B185C, 0xE83E6090, 0xD30D48D4, 0x72949108, 0x49A7B94C,
	0x04F2C180, 0x3FC1E9C4, 0x90E13219, 0xABD21A5D, 0xE6876291, 0xDDB44AD5, 0x7C2D9309, 0x471EBB4D, 0x0A4BC381,
	0x3178EBC5, 0x832A341A, 0xB8191C5E, 0xF54C6492, 0xCE7F4CD6, 0x6FE6950A, 0x54D5BD4E, 0x1980C582, 0x22B3EDC6,
	0x8D93361B, 0xB6A01E5F, 0xFBF56693, 0xC0C64ED7, 0x615F970B, 0x5A6CBF4F, 0x1739C783, 0x2C0AEFC7, 0xA4BC381C,
	0x9F8F1058, 0xD2DA6894, 0xE9E940D0, 0x4870990C, 0x7343B148, 0x3E16C984, 0x0525E1C0, 0xAA053A1D, 0x91361259,
	0xDC636A95, 0xE75042D1, 0x46C99B0D, 0x7DFAB349, 0x30AFCB85, 0x0B9CE3C1, 0xB9CE3C1E, 0x82FD145A, 0xCFA86C96,
	0xF49B44D2, 0x55029D0E, 0x6E31B54A, 0x2364CD86, 0x1857E5C2, 0xB7773E1F, 0x8C44165B, 0xC1116E97, 0xFA2246D3,
	0x5BBB9F0F, 0x6088B74B, 0x2DDDCF87, 0x16EEE7C3 }, {
	0x00000000, 0x993F8230, 0xE55F4441, 0x7C60C671, 0x1D9EC8A3, 0x84A14A93, 0xF8C18CE2, 0x61FE0ED2, 0x3B3D9146,
	0xA2021376, 0xDE62D507, 0x475D5737, 0x26A359E5, 0xBF9CDBD5, 0xC3FC1DA4, 0x5AC39F94, 0x767B228C, 0xEF44A0BC,
	0x932466CD, 0x0A1BE4FD, 0x6BE5EA2F, 0xF2DA681F, 0x8EBAAE6E, 0x17852C5E, 0x4D46B3CA, 0xD47931FA, 0xA819F78B,
	0x312675BB, 0x50D87B69, 0xC9E7F959, 0xB5873F28, 0x2CB8BD18, 0xECF64518, 0x75C9C728, 0x09A90159, 0x90968369,
	0xF1688DBB, 0x68570F8B, 0x1437C9FA, 0x8D084BCA, 0xD7CBD45E, 0x4EF4566E, 0x3294901F, 0xABAB122F, 0xCA551CFD,
	0x536A9ECD, 0x2F0A58BC, 0xB635DA8C, 0x9A8D6794, 0x03B2E5A4, 0x7FD223D5, 0xE6EDA1E5, 0x8713AF37, 0x1E2C2D07,
	0x624CEB76, 0xFB736946, 0xA1B0F6D2, 0x388F74E2, 0x44EFB293, 0xDDD030A3, 0xBC2E3E71, 0x2511BC41, 0x59717A30,
	0xC04EF800, 0x0ECCCA11, 0x97F34821, 0xEB938E50, 0x72AC0C60, 0x135202B2, 0x8A6D8082, 0xF60D46F3, 0x6F32C4C3,
	0x35F15B57, 0xACCED967, 0xD0AE1F16, 0x49919D26, 0x286F93F4, 0xB15011C4, 0xCD30D7B5, 0x540F5585, 0x78B7E89D,
	0xE1886AAD, 0x9DE8ACDC, 0x04D72EEC, 0x6529203E, 0xFC16A20E, 0x8076647F, 0x1949E64F, 0x438A79DB, 0xDAB5FBEB,
	0xA6D53D9A, 0x3FEABFAA, 0x5E14B178, 0xC72B3348, 0xBB4BF539, 0x22747709, 0xE23A8F09, 0x7B050D39, 0x0765CB48,
	0x9E5A4978, 0xFFA447AA, 0x669BC59A, 0x1AFB03EB, 0x83C481DB, 0xD9071E4F, 0x40389C7F, 0x3C585A0E, 0xA567D83E,
	0xC499D6EC, 0x5DA654DC, 0x21C692AD, 0xB8F9109D, 0x9441AD85, 0x0D7E2FB5, 0x711EE9C4, 0xE8216BF4, 0x89DF6526,
	0x10E0E716, 0x6C802167, 0xF5BFA357, 0xAF7C3CC3, 0x3643BEF3, 0x4A237882, 0xD31CFAB2, 0xB2E2F460, 0x2BDD7650,
	0x57BDB021, 0xCE823211, 0x1D999422, 0x84A61612, 0xF8C6D063, 0x61F95253, 0x00075C81, 0x9938DEB1, 0xE55818C0,
	0x7C679AF0, 0x26A40564, 0xBF9B8754, 0xC3FB4125, 0x5AC4C315, 0x3B3ACDC7, 0xA2054FF7, 0xDE658986, 0x475A0BB6,
	0x6BE2B6AE, 0xF2DD349E, 0x8EBDF2EF, 0x178270DF, 0x767C7E0D, 0xEF43FC3D, 0x93233A4C, 0x0A1CB87C, 0x50DF27E8,
	0xC9E0A5D8, 0xB58063A9, 0x2CBFE199, 0x4D41EF4B, 0xD47E6D7B, 0xA81EAB0A, 0x3121293A, 0xF16FD13A, 0x6850530A,
	0x1430957B, 0x8D0F174B, 0xECF11999, 0x75CE9BA9, 0x09AE5DD8, 0x9091DFE8, 0xCA52407C, 0x536DC24C, 0x2F0D043D,
	0xB632860D, 0xD7CC88DF, 0x4EF30AEF, 0x3293CC9E, 0xABAC4EAE, 0x8714F3B6, 0x1E2B7186, 0x624BB7F7, 0xFB7435C7,
	0x9A8A3B15, 0x03B5B925, 0x7FD57F54, 0xE6EAFD64, 0xBC2962F0, 0x2516E0C0, 0x597626B1, 0xC049A481, 0xA1B7AA53,
	0x38882863, 0x44E8EE12, 0xDDD76C22, 0x13555E33, 0x8A6ADC03, 0xF60A1A72, 0x6F359842, 0x0ECB9690, 0x97F414A0,
	0xEB94D2D1, 0x72AB50E1, 0x2868CF75, 0xB1574D45, 0xCD378B34, 0x54080904, 0x35F607D6, 0xACC985E6, 0xD0A94397,
	0x4996C1A7, 0x652E7CBF, 0xFC11FE8F, 0x807138FE, 0x194EBACE, 0x78B0B41C, 0xE18F362C, 0x9DEFF05D, 0x04D0726D,
	0x5E13EDF9, 0xC72C6FC9, 0xBB4CA9B8, 0x22732B88, 0x438D255A, 0xDAB2A76A, 0xA6D2611B, 0x3FEDE32B, 0xFFA31B2B,
	0x669C991B, 0x1AFC5F6A, 0x83C3DD5A, 0xE23DD388, 0x7B0251B8, 0x076297C9, 0x9E5D15F9, 0xC49E8A6D, 0x5DA1085D,
	0x21C1CE2C, 0xB8FE4C1C, 0xD90042CE, 0x403FC0FE, 0x3C5F068F, 0xA56084BF, 0x89D839A7, 0x10E7BB97, 0x6C877DE6,
	0xF5B8FFD6, 0x9446F104, 0x0D797334, 0x7119B545, 0xE8263775, 0xB2E5A8E1, 0x2BDA2AD1, 0x57BAECA0, 0xCE856E90,
	0xAF7B6042, 0x3644E272, 0x4A242403, 0xD31BA633 }, {
	0x00000000, 0x270F3384, 0x4E1E6708, 0x6911548C, 0x9C3CCE10, 0xBB33FD94, 0xD222A918, 0xF52D9A9C, 0xEF59DC01,
	0xC856EF85, 0xA147BB09, 0x8648888D, 0x73651211, 0x546A2195, 0x3D7B7519, 0x1A74469D, 0x0993F823, 0x2E9CCBA7,
	0x478D9F2B, 0x6082ACAF, 0x95AF3633, 0xB2A005B7, 0xDBB1513B, 0xFCBE62BF, 0xE6CA2422, 0xC1C517A6, 0xA8D4432A,
	0x8FDB70AE, 0x7AF6EA32, 0x5DF9D9B6, 0x34E88D3A, 0x13E7BEBE, 0x1327F046, 0x3428C3C2, 0x5D39974E, 0x7A36A4CA,
	0x8F1B3E56, 0xA8140DD2, 0xC105595E, 0xE60A6ADA, 0xFC7E2C47, 0xDB711FC3, 0xB2604B4F, 0x956F78CB, 0x6042E257,
	0x474DD1D3, 0x2E5C855F, 0x0953B6DB, 0x1AB40865, 0x3DBB3BE1, 0x54AA6F6D, 0x73A55CE9, 0x8688C675, 0xA187F5F1,
	0xC896A17D, 0xEF9992F9, 0xF5EDD464, 0xD2E2E7E0, 0xBBF3B36C, 0x9CFC80E8, 0x69D11A74, 0x4EDE29F0, 0x27CF7D7C,
	0x00C04EF8, 0x264FE08C, 0x0140D308, 0x68518784, 0x4F5EB400, 0xBA732E9C, 0x9D7C1D18, 0xF46D4994, 0xD3627A10,
	0xC9163C8D, 0xEE190F09, 0x87085B85, 0xA0076801, 0x552AF29D, 0x7225C119, 0x1B349595, 0x3C3BA611, 0x2FDC18AF,
	0x08D32B2B, 0x61C27FA7, 0x46CD4C23, 0xB3E0D6BF, 0x94EFE53B, 0xFDFEB1B7, 0xDAF18233, 0xC085C4AE, 0xE78AF72A,
	0x8E9BA3A6, 0xA9949022, 0x5CB90ABE, 0x7BB6393A, 0x12A76DB6, 0x35A85E32, 0x356810CA, 0x1267234E, 0x7B7677C2,
	0x5C794446, 0xA954DEDA, 0x8E5BED5E, 0xE74AB9D2, 0xC0458A56, 0xDA31CCCB, 0xFD3EFF4F, 0x942FABC3, 0xB3209847,
	0x460D02DB, 0x6102315F, 0x081365D3, 0x2F1C5657, 0x3CFBE8E9, 0x1BF4DB6D, 0x72E58FE1, 0x55EABC65, 0xA0C726F9,
	0x87C8157D, 0xEED941F1, 0xC9D67275, 0xD3A234E8, 0xF4AD076C, 0x9DBC53E0, 0xBAB36064, 0x4F9EFAF8, 0x6891C97C,
	0x01809DF0, 0x268FAE74, 0x4C9FC118, 0x6B90F29C, 0x0281A610, 0x258E9594, 0xD0A30F08, 0xF7AC3C8C, 0x9EBD6800,
	0xB9B25B84, 0xA3C61D19, 0x84C92E9D, 0xEDD87A11, 0xCAD74995, 0x3FFAD309, 0x18F5E08D, 0x71E4B401, 0x56EB8785,
	0x450C393B, 0x62030ABF, 0x0B125E33, 0x2C1D6DB7, 0xD930F72B, 0xFE3FC4AF, 0x972E9023, 0xB021A3A7, 0xAA55E53A,
	0x8D5AD6BE, 0xE44B8232, 0xC344B1B6, 0x36692B2A, 0x116618AE, 0x78774C22, 0x5F787FA6, 0x5FB8315E, 0x78B702DA,
	0x11A65656, 0x36A965D2, 0xC384FF4E, 0xE48BCCCA, 0x8D9A9846, 0xAA95ABC2, 0xB0E1ED5F, 0x97EEDEDB, 0xFEFF8A57,
	0xD9F0B9D3, 0x2CDD234F, 0x0BD210CB, 0x62C34447, 0x45CC77C3, 0x562BC97D, 0x7124FAF9, 0x1835AE75, 0x3F3A9DF1,
	0xCA17076D, 0xED1834E9, 0x84096065, 0xA30653E1, 0xB972157C, 0x9E7D26F8, 0xF76C7274, 0xD06341F0, 0x254EDB6C,
	0x0241E8E8, 0x6B50BC64, 0x4C5F8FE0, 0x6AD02194, 0x4DDF1210, 0x24CE469C, 0x03C17518, 0xF6ECEF84, 0xD1E3DC00,
	0xB8F2888C, 0x9FFDBB08, 0x8589FD95, 0xA286CE11, 0xCB979A9D, 0xEC98A919, 0x19B53385, 0x3EBA0001, 0x57AB548D,
	0x70A46709, 0x6343D9B7, 0x444CEA33, 0x2D5DBEBF, 0x0A528D3B, 0xFF7F17A7, 0xD8702423, 0xB16170AF, 0x966E432B,
	0x8C1A05B6, 0xAB153632, 0xC20462BE, 0xE50B513A, 0x1026CBA6, 0x3729F822, 0x5E38ACAE, 0x79379F2A, 0x79F7D1D2,
	0x5EF8E256, 0x37E9B6DA, 0x10E6855E, 0xE5CB1FC2, 0xC2C42C46, 0xABD578CA, 0x8CDA4B4E, 0x96AE0DD3, 0xB1A13E57,
	0xD8B06ADB, 0xFFBF595F, 0x0A92C3C3, 0x2D9DF047, 0x448CA4CB, 0x6383974F, 0x706429F1, 0x576B1A75, 0x3E7A4EF9,
	0x19757D7D, 0xEC58E7E1, 0xCB57D465, 0xA24680E9, 0x8549B36D, 0x9F3DF5F0, 0xB832C674, 0xD12392F8, 0xF62CA17C,
	0x03013BE0, 0x240E0864, 0x4D1F5CE8, 0x6A106F6C }, {
	0x00000000, 0x077B8E33, 0x0EF71C66, 0x098C9255, 0x1DEE38CC, 0x1A95B6FF, 0x131924AA, 0x1462AA99, 0x3BDC7198,
	0x3CA7FFAB, 0x352B6DFE, 0x3250E3CD, 0x26324954, 0x2149C767, 0x28C55532, 0x2FBEDB01, 0x77B8E330, 0x70C36D03,
	0x794FFF56, 0x7E347165, 0x6A56DBFC, 0x6D2D55CF, 0x64A1C79A, 0x63DA49A9, 0x4C6492A8, 0x4B1F1C9B, 0x42938ECE,
	0x45E800FD, 0x518AAA64, 0x56F12457, 0x5F7DB602, 0x58063831, 0xEF71C660, 0xE80A4853, 0xE186DA06, 0xE6FD5435,
	0xF29FFEAC, 0xF5E4709F, 0xFC68E2CA, 0xFB136CF9, 0xD4ADB7F8, 0xD3D639CB, 0xDA5AAB9E, 0xDD2125AD, 0xC9438F34,
	0xCE380107, 0xC7B49352, 0xC0CF1D61, 0x98C92550, 0x9FB2AB63, 0x963E3936, 0x9145B705, 0x85271D9C, 0x825C93AF,
	0x8BD001FA, 0x8CAB8FC9, 0xA31554C8, 0xA46EDAFB, 0xADE248AE, 0xAA99C69D, 0xBEFB6C04, 0xB980E237, 0xB00C7062,
	0xB777FE51, 0x09C3CCE1, 0x0EB842D2, 0x0734D087, 0x004F5EB4, 0x142DF42D, 0x13567A1E, 0x1ADAE84B, 0x1DA16678,
	0x321FBD79, 0x3564334A, 0x3CE8A11F, 0x3B932F2C, 0x2FF185B5, 0x288A0B86, 0x210699D3, 0x267D17E0, 0x7E7B2FD1,
	0x7900A1E2, 0x708C33B7, 0x77F7BD84, 0x6395171D, 0x64EE992E, 0x6D620B7B, 0x6A198548, 0x45A75E49, 0x42DCD07A,
	0x4B50422F, 0x4C2BCC1C, 0x58496685, 0x5F32E8B6, 0x56BE7AE3, 0x51C5F4D0, 0xE6B20A81, 0xE1C984B2, 0xE84516E7,
	0xEF3E98D4, 0xFB5C324D, 0xFC27BC7E, 0xF5AB2E2B, 0xF2D0A018, 0xDD6E7B19, 0xDA15F52A, 0xD399677F, 0xD4E2E94C,
	0xC08043D5, 0xC7FBCDE6, 0xCE775FB3, 0xC90CD180, 0x910AE9B1, 0x96716782, 0x9FFDF5D7, 0x98867BE4, 0x8CE4D17D,
	0x8B9F5F4E, 0x8213CD1B, 0x85684328, 0xAAD69829, 0xADAD161A, 0xA421844F, 0xA35A0A7C, 0xB738A0E5, 0xB0432ED6,
	0xB9CFBC83, 0xBEB432B0, 0x138799C2, 0x14FC17F1, 0x1D7085A4, 0x1A0B0B97, 0x0E69A10E, 0x09122F3D, 0x009EBD68,
	0x07E5335B, 0x285BE85A, 0x2F206669, 0x26ACF43C, 0x21D77A0F, 0x35B5D096, 0x32CE5EA5, 0x3B42CCF0, 0x3C3942C3,
	0x643F7AF2, 0x6344F4C1, 0x6AC86694, 0x6DB3E8A7, 0x79D1423E, 0x7EAACC0D, 0x77265E58, 0x705DD06B, 0x5FE30B6A,
	0x58988559, 0x5114170C, 0x566F993F, 0x420D33A6, 0x4576BD95, 0x4CFA2FC0, 0x4B81A1F3, 0xFCF65FA2, 0xFB8DD191,
	0xF20143C4, 0xF57ACDF7, 0xE118676E, 0xE663E95D, 0xEFEF7B08, 0xE894F53B, 0xC72A2E3A, 0xC051A009, 0xC9DD325C,
	0xCEA6BC6F, 0xDAC416F6, 0xDDBF98C5, 0xD4330A90, 0xD34884A3, 0x8B4EBC92, 0x8C3532A1, 0x85B9A0F4, 0x82C22EC7,
	0x96A0845E, 0x91DB0A6D, 0x98579838, 0x9F2C160B, 0xB092CD0A, 0xB7E94339, 0xBE65D16C, 0xB91E5F5F, 0xAD7CF5C6,
	0xAA077BF5, 0xA38BE9A0, 0xA4F06793, 0x1A445523, 0x1D3FDB10, 0x14B34945, 0x13C8C776, 0x07AA6DEF, 0x00D1E3DC,
	0x095D7189, 0x0E26FFBA, 0x219824BB, 0x26E3AA88, 0x2F6F38DD, 0x2814B6EE, 0x3C761C77, 0x3B0D9244, 0x32810011,
	0x35FA8E22, 0x6DFCB613, 0x6A873820, 0x630BAA75, 0x64702446, 0x70128EDF, 0x776900EC, 0x7EE592B9, 0x799E1C8A,
	0x5620C78B, 0x515B49B8, 0x58D7DBED, 0x5FAC55DE, 0x4BCEFF47, 0x4CB57174, 0x4539E321, 0x42426D12, 0xF5359343,
	0xF24E1D70, 0xFBC28F25, 0xFCB90116, 0xE8DBAB8F, 0xEFA025BC, 0xE62CB7E9, 0xE15739DA, 0xCEE9E2DB, 0xC9926CE8,
	0xC01EFEBD, 0xC765708E, 0xD307DA17, 0xD47C5424, 0xDDF0C671, 0xDA8B4842, 0x828D7073, 0x85F6FE40, 0x8C7A6C15,
	0x8B01E226, 0x9F6348BF, 0x9818C68C, 0x919454D9, 0x96EFDAEA, 0xB95101EB, 0xBE2A8FD8, 0xB7A61D8D, 0xB0DD93BE,
	0xA4BF3927, 0xA3C4B714, 0xAA482541, 0xAD33AB72 }, {
	0x00000000, 0x6AC40F44, 0xD5881E88, 0xBF4C11CC, 0x7C307D31, 0x16F47275, 0xA9B863B9, 0xC37C6CFD, 0xF860FA62,
	0x92A4F526, 0x2DE8E4EA, 0x472CEBAE, 0x84508753, 0xEE948817, 0x51D899DB, 0x3B1C969F, 0x27E1B4E5, 0x4D25BBA1,
	0xF269AA6D, 0x98ADA529, 0x5BD1C9D4, 0x3115C690, 0x8E59D75C, 0xE49DD818, 0xDF814E87, 0xB54541C3, 0x0A09500F,
	0x60CD5F4B, 0xA3B133B6, 0xC9753CF2, 0x76392D3E, 0x1CFD227A, 0x4FC369CA, 0x2507668E, 0x9A4B7742, 0xF08F7806,
	0x33F314FB, 0x59371BBF, 0xE67B0A73, 0x8CBF0537, 0xB7A393A8, 0xDD679CEC, 0x622B8D20, 0x08EF8264, 0xCB93EE99,
	0xA157E1DD, 0x1E1BF011, 0x74DFFF55, 0x6822DD2F, 0x02E6D26B, 0xBDAAC3A7, 0xD76ECCE3, 0x1412A01E, 0x7ED6AF5A,
	0xC19ABE96, 0xAB5EB1D2, 0x9042274D, 0xFA862809, 0x45CA39C5, 0x2F0E3681, 0xEC725A7C, 0x86B65538, 0x39FA44F4,
	0x533E4BB0, 0x9F86D394, 0xF542DCD0, 0x4A0ECD1C, 0x20CAC258, 0xE3B6AEA5, 0x8972A1E1, 0x363EB02D, 0x5CFABF69,
	0x67E629F6, 0x0D2226B2, 0xB26E377E, 0xD8AA383A, 0x1BD654C7, 0x71125B83, 0xCE5E4A4F, 0xA49A450B, 0xB8676771,
	0xD2A36835, 0x6DEF79F9, 0x072B76BD, 0xC4571A40, 0xAE931504, 0x11DF04C8, 0x7B1B0B8C, 0x40079D13, 0x2AC39257,
	0x958F839B, 0xFF4B8CDF, 0x3C37E022, 0x56F3EF66, 0xE9BFFEAA, 0x837BF1EE, 0xD045BA5E, 0xBA81B51A, 0x05CDA4D6,
	0x6F09AB92, 0xAC75C76F, 0xC6B1C82B, 0x79FDD9E7, 0x1339D6A3, 0x2825403C, 0x42E14F78, 0xFDAD5EB4, 0x976951F0,
	0x54153D0D, 0x3ED13249, 0x819D2385, 0xEB592CC1, 0xF7A40EBB, 0x9D6001FF, 0x222C1033, 0x48E81F77, 0x8B94738A,
	0xE1507CCE, 0x5E1C6D02, 0x34D86246, 0x0FC4F4D9, 0x6500FB9D, 0xDA4CEA51, 0xB088E515, 0x73F489E8, 0x193086AC,
	0xA67C9760, 0xCCB89824, 0xE82DE709, 0x82E9E84D, 0x3DA5F981, 0x5761F6C5, 0x941D9A38, 0xFED9957C, 0x419584B0,
	0x2B518BF4, 0x104D1D6B, 0x7A89122F, 0xC5C503E3, 0xAF010CA7, 0x6C7D605A, 0x06B96F1E, 0xB9F57ED2, 0xD3317196,
	0xCFCC53EC, 0xA5085CA8, 0x1A444D64, 0x70804220, 0xB3FC2EDD, 0xD9382199, 0x66743055, 0x0CB03F11, 0x37ACA98E,
	0x5D68A6CA, 0xE224B706, 0x88E0B842, 0x4B9CD4BF, 0x2158DBFB, 0x9E14CA37, 0xF4D0C573, 0xA7EE8EC3, 0xCD2A8187,
	0x7266904B, 0x18A29F0F, 0xDBDEF3F2, 0xB11AFCB6, 0x0E56ED7A, 0x6492E23E, 0x5F8E74A1, 0x354A7BE5, 0x8A066A29,
	0xE0C2656D, 0x23BE0990, 0x497A06D4, 0xF6361718, 0x9CF2185C, 0x800F3A26, 0xEACB3562, 0x558724AE, 0x3F432BEA,
	0xFC3F4717, 0x96FB4853, 0x29B7599F, 0x437356DB, 0x786FC044, 0x12ABCF00, 0xADE7DECC, 0xC723D188, 0x045FBD75,
	0x6E9BB231, 0xD1D7A3FD, 0xBB13ACB9, 0x77AB349D, 0x1D6F3BD9, 0xA2232A15, 0xC8E72551, 0x0B9B49AC, 0x615F46E8,
	0xDE135724, 0xB4D75860, 0x8FCBCEFF, 0xE50FC1BB, 0x5A43D077, 0x3087DF33, 0xF3FBB3CE, 0x993FBC8A, 0x2673AD46,
	0x4CB7A202, 0x504A8078, 0x3A8E8F3C, 0x85C29EF0, 0xEF0691B4, 0x2C7AFD49, 0x46BEF20D, 0xF9F2E3C1, 0x9336EC85,
	0xA82A7A1A, 0xC2EE755E, 0x7DA26492, 0x17666BD6, 0xD41A072B, 0xBEDE086F, 0x019219A3, 0x6B5616E7, 0x38685D57,
	0x52AC5213, 0xEDE043DF, 0x87244C9B, 0x44582066, 0x2E9C2F22, 0x91D03EEE, 0xFB1431AA, 0xC008A735, 0xAACCA871,
	0x1580B9BD, 0x7F44B6F9, 0xBC38DA04, 0xD6FCD540, 0x69B0C48C, 0x0374CBC8, 0x1F89E9B2, 0x754DE6F6, 0xCA01F73A,
	0xA0C5F87E, 0x63B99483, 0x097D9BC7, 0xB6318A0B, 0xDCF5854F, 0xE7E913D0, 0x8D2D1C94, 0x32610D58, 0x58A5021C,
	0x9BD96EE1, 0xF11D61A5, 0x4E517069, 0x24957F2D }, {
	0x00000000, 0x996E7517, 0xE5FCAA0F, 0x7C92DF18, 0x1CD9143F, 0x85B76128, 0xF925BE30, 0x604BCB27, 0x39B2287E,
	0xA0DC5D69, 0xDC4E8271, 0x4520F766, 0x256B3C41, 0xBC054956, 0xC097964E, 0x59F9E359, 0x736450FC, 0xEA0A25EB,
	0x9698FAF3, 0x0FF68FE4, 0x6FBD44C3, 0xF6D331D4, 0x8A41EECC, 0x132F9BDB, 0x4AD67882, 0xD3B80D95, 0xAF2AD28D,
	0x3644A79A, 0x560F6CBD, 0xCF6119AA, 0xB3F3C6B2, 0x2A9DB3A5, 0xE6C8A1F8, 0x7FA6D4EF, 0x03340BF7, 0x9A5A7EE0,
	0xFA11B5C7, 0x637FC0D0, 0x1FED1FC8, 0x86836ADF, 0xDF7A8986, 0x4614FC91, 0x3A862389, 0xA3E8569E, 0xC3A39DB9,
	0x5ACDE8AE, 0x265F37B6, 0xBF3142A1, 0x95ACF104, 0x0CC28413, 0x70505B0B, 0xE93E2E1C, 0x8975E53B, 0x101B902C,
	0x6C894F34, 0xF5E73A23, 0xAC1ED97A, 0x3570AC6D, 0x49E27375, 0xD08C0662, 0xB0C7CD45, 0x29A9B852, 0x553B674A,
	0xCC55125D, 0x1AB103D1, 0x83DF76C6, 0xFF4DA9DE, 0x6623DCC9, 0x066817EE, 0x9F0662F9, 0xE394BDE1, 0x7AFAC8F6,
	0x23032BAF, 0xBA6D5EB8, 0xC6FF81A0, 0x5F91F4B7, 0x3FDA3F90, 0xA6B44A87, 0xDA26959F, 0x4348E088, 0x69D5532D,
	0xF0BB263A, 0x8C29F922, 0x15478C35, 0x750C4712, 0xEC623205, 0x90F0ED1D, 0x099E980A, 0x50677B53, 0xC9090E44,
	0xB59BD15C, 0x2CF5A44B, 0x4CBE6F6C, 0xD5D01A7B, 0xA942C563, 0x302CB074, 0xFC79A229, 0x6517D73E, 0x19850826,
	0x80EB7D31, 0xE0A0B616, 0x79CEC301, 0x055C1C19, 0x9C32690E, 0xC5CB8A57, 0x5CA5FF40, 0x20372058, 0xB959554F,
	0xD9129E68, 0x407CEB7F, 0x3CEE3467, 0xA5804170, 0x8F1DF2D5, 0x167387C2, 0x6AE158DA, 0xF38F2DCD, 0x93C4E6EA,
	0x0AAA93FD, 0x76384CE5, 0xEF5639F2, 0xB6AFDAAB, 0x2FC1AFBC, 0x535370A4, 0xCA3D05B3, 0xAA76CE94, 0x3318BB83,
	0x4F8A649B, 0xD6E4118C, 0x356207A2, 0xAC0C72B5, 0xD09EADAD, 0x49F0D8BA, 0x29BB139D, 0xB0D5668A, 0xCC47B992,
	0x5529CC85, 0x0CD02FDC, 0x95BE5ACB, 0xE92C85D3, 0x7042F0C4, 0x10093BE3, 0x89674EF4, 0xF5F591EC, 0x6C9BE4FB,
	0x4606575E, 0xDF682249, 0xA3FAFD51, 0x3A948846, 0x5ADF4361, 0xC3B13676, 0xBF23E96E, 0x264D9C79, 0x7FB47F20,
	0xE6DA0A37, 0x9A48D52F, 0x0326A038, 0x636D6B1F, 0xFA031E08, 0x8691C110, 0x1FFFB407, 0xD3AAA65A, 0x4AC4D34D,
	0x36560C55, 0xAF387942, 0xCF73B265, 0x561DC772, 0x2A8F186A, 0xB3E16D7D, 0xEA188E24, 0x7376FB33, 0x0FE4242B,
	0x968A513C, 0xF6C19A1B, 0x6FAFEF0C, 0x133D3014, 0x8A534503, 0xA0CEF6A6, 0x39A083B1, 0x45325CA9, 0xDC5C29BE,
	0xBC17E299, 0x2579978E, 0x59EB4896, 0xC0853D81, 0x997CDED8, 0x0012ABCF, 0x7C8074D7, 0xE5EE01C0, 0x85A5CAE7,
	0x1CCBBFF0, 0x605960E8, 0xF93715FF, 0x2FD30473, 0xB6BD7164, 0xCA2FAE7C, 0x5341DB6B, 0x330A104C, 0xAA64655B,
	0xD6F6BA43, 0x4F98CF54, 0x16612C0D, 0x8F0F591A, 0xF39D8602, 0x6AF3F315, 0x0AB83832, 0x93D64D25, 0xEF44923D,
	0x762AE72A, 0x5CB7548F, 0xC5D92198, 0xB94BFE80, 0x20258B97, 0x406E40B0, 0xD90035A7, 0xA592EABF, 0x3CFC9FA8,
	0x65057CF1, 0xFC6B09E6, 0x80F9D6FE, 0x1997A3E9, 0x79DC68CE, 0xE0B21DD9, 0x9C20C2C1, 0x054EB7D6, 0xC91BA58B,
	0x5075D09C, 0x2CE70F84, 0xB5897A93, 0xD5C2B1B4, 0x4CACC4A3, 0x303E1BBB, 0xA9506EAC, 0xF0A98DF5, 0x69C7F8E2,
	0x155527FA, 0x8C3B52ED, 0xEC7099CA, 0x751EECDD, 0x098C33C5, 0x90E246D2, 0xBA7FF577, 0x23118060, 0x5F835F78,
	0xC6ED2A6F, 0xA6A6E148, 0x3FC8945F, 0x435A4B47, 0xDA343E50, 0x83CDDD09, 0x1AA3A81E, 0x66317706, 0xFF5F0211,
	0x9F14C936, 0x067ABC21, 0x7AE86339, 0xE386162E }, {
	0x00000000, 0xBC72B3AB, 0xAFC52777, 0x13B794DC, 0x88AA0ECF, 0x34D8BD64, 0x276F29B8, 0x9B1D9A13, 0xC6745DBF,
	0x7A06EE14, 0x69B17AC8, 0xD5C3C963, 0x4EDE5370, 0xF2ACE0DB, 0xE11B7407, 0x5D69C7AC, 0x5BC8FB5F, 0xE7BA48F4,
	0xF40DDC28, 0x487F6F83, 0xD362F590, 0x6F10463B, 0x7CA7D2E7, 0xC0D5614C, 0x9DBCA6E0, 0x21CE154B, 0x32798197,
	0x8E0B323C, 0x1516A82F, 0xA9641B84, 0xBAD38F58, 0x06A13CF3, 0xB791F6BE, 0x0BE34515, 0x1854D1C9, 0xA4266262,
	0x3F3BF871, 0x83494BDA, 0x90FEDF06, 0x2C8C6CAD, 0x71E5AB01, 0xCD9718AA, 0xDE208C76, 0x62523FDD, 0xF94FA5CE,
	0x453D1665, 0x568A82B9, 0xEAF83112, 0xEC590DE1, 0x502BBE4A, 0x439C2A96, 0xFFEE993D, 0x64F3032E, 0xD881B085,
	0xCB362459, 0x774497F2, 0x2A2D505E, 0x965FE3F5, 0x85E87729, 0x399AC482, 0xA2875E91, 0x1EF5ED3A, 0x0D4279E6,
	0xB130CA4D, 0xB803AD5D, 0x04711EF6, 0x17C68A2A, 0xABB43981, 0x30A9A392, 0x8CDB1039, 0x9F6C84E5, 0x231E374E,
	0x7E77F0E2, 0xC2054349, 0xD1B2D795, 0x6DC0643E, 0xF6DDFE2D, 0x4AAF4D86, 0x5918D95A, 0xE56A6AF1, 0xE3CB5602,
	0x5FB9E5A9, 0x4C0E7175, 0xF07CC2DE, 0x6B6158CD, 0xD713EB66, 0xC4A47FBA, 0x78D6CC11, 0x25BF0BBD, 0x99CDB816,
	0x8A7A2CCA, 0x36089F61, 0xAD150572, 0x1167B6D9, 0x02D02205, 0xBEA291AE, 0x0F925BE3, 0xB3E0E848, 0xA0577C94,
	0x1C25CF3F, 0x8738552C, 0x3B4AE687, 0x28FD725B, 0x948FC1F0, 0xC9E6065C, 0x7594B5F7, 0x6623212B, 0xDA519280,
	0x414C0893, 0xFD3EBB38, 0xEE892FE4, 0x52FB9C4F, 0x545AA0BC, 0xE8281317, 0xFB9F87CB, 0x47ED3460, 0xDCF0AE73,
	0x60821DD8, 0x73358904, 0xCF473AAF, 0x922EFD03, 0x2E5C4EA8, 0x3DEBDA74, 0x819969DF, 0x1A84F3CC, 0xA6F64067,
	0xB541D4BB, 0x09336710, 0xA7271A9B, 0x1B55A930, 0x08E23DEC, 0xB4908E47, 0x2F8D1454, 0x93FFA7FF, 0x80483323,
	0x3C3A8088, 0x61534724, 0xDD21F48F, 0xCE966053, 0x72E4D3F8, 0xE9F949EB, 0x558BFA40, 0x463C6E9C, 0xFA4EDD37,
	0xFCEFE1C4, 0x409D526F, 0x532AC6B3, 0xEF587518, 0x7445EF0B, 0xC8375CA0, 0xDB80C87C, 0x67F27BD7, 0x3A9BBC7B,
	0x86E90FD0, 0x955E9B0C, 0x292C28A7, 0xB231B2B4, 0x0E43011F, 0x1DF495C3, 0xA1862668, 0x10B6EC25, 0xACC45F8E,
	0xBF73CB52, 0x030178F9, 0x981CE2EA, 0x246E5141, 0x37D9C59D, 0x8BAB7636, 0xD6C2B19A, 0x6AB00231, 0x790796ED,
	0xC5752546, 0x5E68BF55, 0xE21A0CFE, 0xF1AD9822, 0x4DDF2B89, 0x4B7E177A, 0xF70CA4D1, 0xE4BB300D, 0x58C983A6,
	0xC3D419B5, 0x7FA6AA1E, 0x6C113EC2, 0xD0638D69, 0x8D0A4AC5, 0x3178F96E, 0x22CF6DB2, 0x9EBDDE19, 0x05A0440A,
	0xB9D2F7A1, 0xAA65637D, 0x1617D0D6, 0x1F24B7C6, 0xA356046D, 0xB0E190B1, 0x0C93231A, 0x978EB909, 0x2BFC0AA2,
	0x384B9E7E, 0x84392DD5, 0xD950EA79, 0x652259D2, 0x7695CD0E, 0xCAE77EA5, 0x51FAE4B6, 0xED88571D, 0xFE3FC3C1,
	0x424D706A, 0x44EC4C99, 0xF89EFF32, 0xEB296BEE, 0x575BD845, 0xCC464256, 0x7034F1FD, 0x63836521, 0xDFF1D68A,
	0x82981126, 0x3EEAA28D, 0x2D5D3651, 0x912F85FA, 0x0A321FE9, 0xB640AC42, 0xA5F7389E, 0x19858B35, 0xA8B54178,
	0x14C7F2D3, 0x0770660F, 0xBB02D5A4, 0x201F4FB7, 0x9C6DFC1C, 0x8FDA68C0, 0x33A8DB6B, 0x6EC11CC7, 0xD2B3AF6C,
	0xC1043BB0, 0x7D76881B, 0xE66B1208, 0x5A19A1A3, 0x49AE357F, 0xF5DC86D4, 0xF37DBA27, 0x4F0F098C, 0x5CB89D50,
	0xE0CA2EFB, 0x7BD7B4E8, 0xC7A50743, 0xD412939F, 0x68602034, 0x3509E798, 0x897B5433, 0x9ACCC0EF, 0x26BE7344,
	0xBDA3E957, 0x01D15AFC, 0x1266CE20, 0xAE147D8B }, {
	0x00000000, 0x9224206A, 0xF36800F5, 0x614C209F, 0x31F041CB, 0xA3D461A1, 0xC298413E, 0x50BC6154, 0x63E08396,
	0xF1C4A3FC, 0x90888363, 0x02ACA309, 0x5210C25D, 0xC034E237, 0xA178C2A8, 0x335CE2C2, 0xC7C1072C, 0x55E52746,
	0x34A907D9, 0xA68D27B3, 0xF63146E7, 0x6415668D, 0x05594612, 0x977D6678, 0xA42184BA, 0x3605A4D0, 0x5749844F,
	0xC56DA425, 0x95D1C571, 0x07F5E51B, 0x66B9C584, 0xF49DE5EE, 0x58A24E79, 0xCA866E13, 0xABCA4E8C, 0x39EE6EE6,
	0x69520FB2, 0xFB762FD8, 0x9A3A0F47, 0x081E2F2D, 0x3B42CDEF, 0xA966ED85, 0xC82ACD1A, 0x5A0EED70, 0x0AB28C24,
	0x9896AC4E, 0xF9DA8CD1, 0x6BFEACBB, 0x9F634955, 0x0D47693F, 0x6C0B49A0, 0xFE2F69CA, 0xAE93089E, 0x3CB728F4,
	0x5DFB086B, 0xCFDF2801, 0xFC83CAC3, 0x6EA7EAA9, 0x0FEBCA36, 0x9DCFEA5C, 0xCD738B08, 0x5F57AB62, 0x3E1B8BFD,
	0xAC3FAB97, 0xB1449CF2, 0x2360BC98, 0x422C9C07, 0xD008BC6D, 0x80B4DD39, 0x1290FD53, 0x73DCDDCC, 0xE1F8FDA6,
	0xD2A41F64, 0x40803F0E, 0x21CC1F91, 0xB3E83FFB, 0xE3545EAF, 0x71707EC5, 0x103C5E5A, 0x82187E30, 0x76859BDE,
	0xE4A1BBB4, 0x85ED9B2B, 0x17C9BB41, 0x4775DA15, 0xD551FA7F, 0xB41DDAE0, 0x2639FA8A, 0x15651848, 0x87413822,
	0xE60D18BD, 0x742938D7, 0x24955983, 0xB6B179E9, 0xD7FD5976, 0x45D9791C, 0xE9E6D28B, 0x7BC2F2E1, 0x1A8ED27E,
	0x88AAF214, 0xD8169340, 0x4A32B32A, 0x2B7E93B5, 0xB95AB3DF, 0x8A06511D, 0x18227177, 0x796E51E8, 0xEB4A7182,
	0xBBF610D6, 0x29D230BC, 0x489E1023, 0xDABA3049, 0x2E27D5A7, 0xBC03F5CD, 0xDD4FD552, 0x4F6BF538, 0x1FD7946C,
	0x8DF3B406, 0xECBF9499, 0x7E9BB4F3, 0x4DC75631, 0xDFE3765B, 0xBEAF56C4, 0x2C8B76AE, 0x7C3717FA, 0xEE133790,
	0x8F5F170F, 0x1D7B3765, 0xB5A979C5, 0x278D59AF, 0x46C17930, 0xD4E5595A, 0x8459380E, 0x167D1864, 0x773138FB,
	0xE5151891, 0xD649FA53, 0x446DDA39, 0x2521FAA6, 0xB705DACC, 0xE7B9BB98, 0x759D9BF2, 0x14D1BB6D, 0x86F59B07,
	0x72687EE9, 0xE04C5E83, 0x81007E1C, 0x13245E76, 0x43983F22, 0xD1BC1F48, 0xB0F03FD7, 0x22D41FBD, 0x1188FD7F,
	0x83ACDD15, 0xE2E0FD8A, 0x70C4DDE0, 0x2078BCB4, 0xB25C9CDE, 0xD310BC41, 0x41349C2B, 0xED0B37BC, 0x7F2F17D6,
	0x1E633749, 0x8C471723, 0xDCFB7677, 0x4EDF561D, 0x2F937682, 0xBDB756E8, 0x8EEBB42A, 0x1CCF9440, 0x7D83B4DF,
	0xEFA794B5, 0xBF1BF5E1, 0x2D3FD58B, 0x4C73F514, 0xDE57D57E, 0x2ACA3090, 0xB8EE10FA, 0xD9A23065, 0x4B86100F,
	0x1B3A715B, 0x891E5131, 0xE85271AE, 0x7A7651C4, 0x492AB306, 0xDB0E936C, 0xBA42B3F3, 0x28669399, 0x78DAF2CD,
	0xEAFED2A7, 0x8BB2F238, 0x1996D252, 0x04EDE537, 0x96C9C55D, 0xF785E5C2, 0x65A1C5A8, 0x351DA4FC, 0xA7398496,
	0xC675A409, 0x54518463, 0x670D66A1, 0xF52946CB, 0x94656654, 0x0641463E, 0x56FD276A, 0xC4D90700, 0xA595279F,
	0x37B107F5, 0xC32CE21B, 0x5108C271, 0x3044E2EE, 0xA260C284, 0xF2DCA3D0, 0x60F883BA, 0x01B4A325, 0x9390834F,
	0xA0CC618D, 0x32E841E7, 0x53A46178, 0xC1804112, 0x913C2046, 0x0318002C, 0x625420B3, 0xF07000D9, 0x5C4FAB4E,
	0xCE6B8B24, 0xAF27ABBB, 0x3D038BD1, 0x6DBFEA85, 0xFF9BCAEF, 0x9ED7EA70, 0x0CF3CA1A, 0x3FAF28D8, 0xAD8B08B2,
	0xCCC7282D, 0x5EE30847, 0x0E5F6913, 0x9C7B4979, 0xFD3769E6, 0x6F13498C, 0x9B8EAC62, 0x09AA8C08, 0x68E6AC97,
	0xFAC28CFD, 0xAA7EEDA9, 0x385ACDC3, 0x5916ED5C, 0xCB32CD36, 0xF86E2FF4, 0x6A4A0F9E, 0x0B062F01, 0x99220F6B,
	0xC99E6E3F, 0x5BBA4E55, 0x3AF66ECA, 0xA8D24EA0 } };

/**
 * Implements a 32-bit CRC check following the general, slice-by-eight
 * method outlined in ftp://download.intel.com/technology/comms/perfnet/download/slicing-by-8.pdf
 *
 * @param m_buf Pointer to a character array for which we would like to calculate the CRC
 * @param m_size Number of bytes to use from #buf for the CRC
 * @param m_seed Seed value to use for CRC
 * @return Computed CRC value.  This function can not fail.
 */
uint32_t
ebex_crc32(const uint8_t *m_buf, size_t m_size, uint32_t m_seed)
{
	register uint32_t seed_val = ~m_seed;

	if (m_size > 8)
	{
		while ((uintptr_t) (m_buf) & 7)
		{
			seed_val = ebex_crc32_table[0][*m_buf++ ^ LOW_BYTE(seed_val)] ^ (seed_val>>8);
			--m_size;
		}

		const uint8_t * const stop_pos = m_buf + (m_size & ~(size_t) (7));

		m_size &= (size_t) (7);

		while (m_buf < stop_pos)
		{
			seed_val ^= *(const uint32_t *) (m_buf);
			m_buf += 4;

			seed_val = 	ebex_crc32_table[7][LOW_BYTE(seed_val)] ^
						ebex_crc32_table[6][LOW_BYTE(seed_val>>8)] ^
						ebex_crc32_table[5][HIGH_BYTE(seed_val)] ^
						ebex_crc32_table[4][HIGH_NYBLE(seed_val)];

			const uint32_t tmp = *(const uint32_t *) (m_buf);
			m_buf += 4;

			seed_val = 	ebex_crc32_table[3][LOW_BYTE(tmp)] ^
						ebex_crc32_table[2][LOW_BYTE(tmp>>8)] ^
						seed_val ^
						ebex_crc32_table[1][HIGH_BYTE(tmp)]	^
						ebex_crc32_table[0][HIGH_NYBLE(tmp)];
		}
	}

	while (m_size-- != 0)
		seed_val = ebex_crc32_table[0][*m_buf++ ^ LOW_BYTE(seed_val)] ^ (seed_val>>8);

	return ~seed_val;
}

/**
 * Implements a 16-bit CRC check using the polynomial described in "The Single Burst Error Detection Performance of Binary Cyclic Codes",
 * IEEE TransComm 1994, VOL 42; NUMBER 1, pages 11.
 *
 * @param m_buf Pointer to a character array for which we would like to calculate the CRC
 * @param m_size Number of bytes to use from #m_buf for the CRC
 * @param m_seed Seed value to use for CRC
 * @return Computed CRC value.  This function can not fail.
 */
uint16_t
ebex_crc16(const uint8_t *m_buf, size_t m_size, uint16_t m_seed)
{
	register uint16_t seed_val = ~m_seed;
    while (m_size--)
    {
        seed_val = ebex_crc16_table[*m_buf++ ^ (uint8_t)(seed_val >> 8)] ^ (seed_val << 8);
    }
    return ~seed_val;
}
